home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000164_Martyn.Johnson@cl.cam.ac.uk_Mon Jan 17 16:45:52 1994.msg < prev    next >
Internet Message Format  |  1994-10-11  |  2KB

  1. Received: from swan.cl.cam.ac.uk by cs.umb.edu with SMTP id AA28902
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Tue, 18 Jan 1994 18:22:38 -0500
  3. Received: from labes.cl.cam.ac.uk (user maj (rfc931)) by swan.cl.cam.ac.uk 
  4.           with SMTP (PP-6.5) to cl; Mon, 17 Jan 1994 16:46:00 +0000
  5. To: tex-k@cs.umb.edu
  6. Cc: Martyn.Johnson@cl.cam.ac.uk
  7. Subject: Security problem in dvipsk "secure" mode
  8. Date: Mon, 17 Jan 1994 16:45:52 +0000
  9. From: Martyn Johnson <Martyn.Johnson@cl.cam.ac.uk>
  10. Message-Id: <"swan.cl.cam.:245650:940117164604"@cl.cam.ac.uk>
  11.  
  12. dvips[k] has a "secure" mode, turned on by the -R flag. This is
  13. something I asked for some time ago, though I do not know whether what
  14. was done was in direct response to my suggestion or not.
  15.  
  16. The spec does not say PRECISELY what the mode is supposed to do, but my
  17. understanding is that it is intended to inhibit certain actions which
  18. might be dangerous if dvips is being run with a user's input but in a
  19. different protection environment (e.g. dvips being run in a spooler
  20. machine, possibly in a privileged environment).
  21.  
  22. Unfortunately a security hole remains - even in secure mode it is
  23. possible to READ an arbitrary file and cause it to appear in the
  24. output. I would suggest that this ought to be locked out.
  25.  
  26. To fix this problem means touching code which is different in dvips and
  27. dvipsk.  I have just applied the following change to dvipsk, which does
  28. what I want. The maintainers of dvips[k] might like to consider whether
  29. this change should be made.
  30.  
  31. *** 1.1 1994/01/17 15:10:27
  32. --- search.c    1994/01/17 16:19:49
  33. ***************
  34. *** 19,32 ****
  35.   extern char *mfmode ;
  36.   extern int actualdpi ;
  37.   string realnameoffile ;
  38.   
  39.   FILE *
  40.   search(path, file, mode)
  41.       char *path, *file, *mode ;
  42.   {
  43.     FILE *ret;
  44. !   string name = kpse_path_search (path, file);
  45.   
  46.     if (name)
  47.       {
  48.         ret = fopen (name, mode);
  49. --- 19,36 ----
  50.   extern char *mfmode ;
  51.   extern int actualdpi ;
  52.   string realnameoffile ;
  53. + extern Boolean secure ;
  54.   
  55.   FILE *
  56.   search(path, file, mode)
  57.       char *path, *file, *mode ;
  58.   {
  59.     FILE *ret;
  60. !   string name;
  61.   
  62. +   if (secure && kpse_absolute_p (file)) return NULL;
  63. +   name = kpse_path_search (path, file);
  64.     if (name)
  65.       {
  66.         ret = fopen (name, mode);
  67.  
  68.  
  69.  
  70.  
  71. Martyn Johnson      maj@cl.cam.ac.uk
  72. University of Cambridge Computer Lab
  73. Cambridge UK